﻿@using PagedList;
@using PagedList.Mvc;
@model IPagedList<WebBanHang.Models.SanPham>

@{
    ViewBag.Title = "Index";
}

<div class="div_box2">
    <div class="div_box2_title">
        <div class="div_box2_title_left"></div>
        <div class="div_box2_title_center">
            <h3>Danh Mục Sản Phẩm</h3>
        </div>
        <div class="div_box2_title_right"></div>
    </div>
    <div class="div_box2_content">
        <div class="product_list">
            @foreach (var sanPham in this.Model)
            {
                <div class="product_list_detail colborder_all">
                    <div class="product_list_detail_image">
                        <a title="@sanPham.TenSanPham" href="@Url.Action("Details", "SanPham", new { id = sanPham.SanPhamId })">
                            <img  src="~/Images/Upload/Products/@sanPham.HinhAnh" />
                        </a>
                    </div>
                    <div class="product_list_detail_name">
                        <a  title="@sanPham.TenSanPham" href="@Url.Action("Details", "SanPham", new { id = sanPham.SanPhamId })">
                            @sanPham.TenSanPham
                        </a>
                    </div>
                    <div class="product_list_detail_price">
                        Giá: @sanPham.Gia.Value.ToString("n0")
                    </div>
                </div>        
            }
        </div>
        <div class="clear"></div>
        <div>
            @Html.PagedListPager(this.Model, page => Url.Action("Index", "SanPham", new { page }), PagedListRenderOptions.PageNumbersOnly)
        </div>
    </div>
</div>
@section Scripts 
{
    <link href="~/Content/PagedList.css" rel="stylesheet" />
}
